import mongoose from 'mongoose'

const projectEmployeeLinkSchema = new mongoose.Schema({
  project: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'project',
    required: true,
  },
  employee: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'employee',
    required: true,
  },
  periods: {
    type: Object,
    required: true
  },
  comment: {
    type: String,
    required: false
  }
})

export default mongoose.model('project-employee-link', projectEmployeeLinkSchema)
